package com.refusea.train.controller

import com.refusea.train.domain.entity.RichText
import com.refusea.train.domain.helper.RichTextHelper
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

/**
 * @author Zhang Yan 2024/3/30
 **/
@RestController
@RequestMapping("/api/private/rt")
class RichTextController(private val richTextHelper: RichTextHelper) {

    @PostMapping("/save")
    fun save(@RequestBody req: RichText): Int {
        return richTextHelper.save(req)
    }

    @PostMapping("/query")
    fun query(@RequestBody req: RichText): RichText? {
        return richTextHelper.query(req)
    }
}
